<template>
  <div class="menu">
    <el-menu :default-active="route.path" class="el-menu-vertical-demo" router>
      <el-menu-item index="/">
        <el-icon><icon-menu /></el-icon>
        <span>主页</span>
      </el-menu-item>

      <el-sub-menu index="/users">
        <template #title>
          <el-icon><location /></el-icon>
          <span>用户管理</span>
        </template>
        <el-menu-item index="/users/list">
          <el-icon><icon-menu /></el-icon>
          <span>用户列表</span>
        </el-menu-item>
      </el-sub-menu>
    </el-menu>
  </div>
</template>

<script setup>
import { useRoute, useRouter } from 'vue-router'

const router = useRouter()
const route = useRoute()
</script>

<style lang="scss" scoped>
.menu {
  width: 100%;
  height: 100%;

  .el-menu {
    height: 100%;
  }
}
</style>
